package com.qq.spirit;

import java.io.IOException;
import java.util.Properties;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.PropertyConfigurator;

public class LoggerUtil
{
	static
	{
		try
		{
			Properties pro = new Properties();
			pro.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("log4j.property"));
			PropertyConfigurator.configure(pro);
		} catch (IOException e)
		{
			e.printStackTrace();
		}
	}
	private static Log log = LogFactory.getLog("stdout");

	public static void error(Exception ex)
	{
		log.error(ex.getMessage(),ex);
	}

	public static void logger(String s)
	{
		log.debug(s);
	}

	public static void info(String s)
	{
		log.info(s);
	}
	
	public static void debug(String s)
	{
		log.debug(s);
	}
}
